package io.afu.nginxhelper.dto.http;

import io.afu.nginxhelper.constant.NgxConst;

import java.util.Map;

public class MimeTypes {

    public static final String KEY = "types";

    private Map<String,String> types;

    public Map<String, String> getTypes() {
        return types;
    }

    public void setTypes(Map<String, String> types) {
        this.types = types;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(MimeTypes.KEY).append(NgxConst.SEP).append(NgxConst.BLOCK_START);
        for (Map.Entry<String,String> entry:types.entrySet()){
            sb.append(entry.getKey()).append(NgxConst.SEP).append(entry.getValue());
        }
        sb.append(NgxConst.BLOCK_END);
        return sb.toString();
    }
}
